<!DOCTYPE html>
<head>
<meta charset="utf-8"/>
<script src="jquery.min.js"></script>
<script>
$(document).ready(function(){
	var background = chrome.extension.getBackgroundPage();
	$('#write').click(function(e){
		background.writeEvent("Pgtos - Empresa");
		return false;
	});
	$('#logInOut').click(function(e){
		if (background.isLogged()){
			background.logout();
			$(this).text('Login');
		}
		else{
			background.login(function(){
				$(this).text('Logout');	
			});			
		}
		return false;
	});
});
</script>
</head>
<body>
<div style="width:200px;cursor:pointer;">
	<span id="write">Write</span>
	<span id="logInOut">Login</span>
</div>
</body>
</html>